#ifndef GUIPLUGIN1_H
#define GUIPLUGIN1_H

#include "guiplugin1_global.h"

#include <pluginui/plugin/GuiPlugin.h>
using namespace antu::plugin;
using namespace antu::plugin::ui;

/**
 * @brief How to create your own plugin?
 *
 * First, you need to decide whether you need to have GUI interface or not.
 * The basic guideline is to sub-class an AbstractPlugin if you do not need
 * GUI interface, and sub-class a GuiPlugin if you do.
 *
 * Second, you need to create your description xml for your plugin. Information
 * such as plugin's code, which is used by the plugin system to locate the plugin;
 * name, a brief description of what the plugin does; the version of the plugin and
 * its minimum compatible version, such that other plugins know whether they can
 * still invoke services provided by this plugin; what plugins your plugin depends
 * on. The name of the plugin file must be the same as the library file. In
 * Windows, this means if you create a guiplugin1.dll, your description must be
 * guiplugin1.xml.
 *
 * Third, you need to add in code to respond to your plugin's life cycle
 * methods, like what it should do when it's initialized, started, and stopped.
 * You'd also need to pay attention to i18n issues of course.
 *
 * Last, add in your plugin's logic handling code that actually does what it
 * should do.
 *
 * Oh, one very important issue we missed? How would the system know how to
 * instantiate your plugin? Write a function:
 *
 * extern "C" void InitFactory(const QString& code)
 *
 * and make sure you export it!
 */
class GUIPLUGIN1SHARED_EXPORT Guiplugin1 : public GuiPlugin
{

public:
    Guiplugin1(PluginDescriptionSharedPtr pDescription, ServiceRegistry* pServiceRegistry);

protected:
    virtual void doStartMenu(AbstractMenuManager* pMenuManager);
    virtual void doStartToolBar(AbstractToolBarManager* pToolBarManager);
    virtual void doStartContentPanel(AbstractPanelManager* pContentPanelManager);
    virtual void doStartStatusBar(AbstractStatusBarManager* pStatusBarManager);
    virtual void doStartSidePanel(AbstractPanelManager* pSidePanelManager);

protected:
    virtual void doInit(PluginContext* pContext);

    virtual void doStart();

    virtual void doStop();

    virtual void doFinishStartup();

    /**
     * @brief A required service is found, need to override this to keep track of required service.
     * @param pService pointer to required service.
     */
    virtual void requiredServiceFound(AbstractService* pService);
};

extern "C" void GUIPLUGIN1SHARED_EXPORT InitFactory(const QString& code);

#endif // GUIPLUGIN1_H
